Part Number Hot Search : 
924E34 2N1122 UPD17010 4GBJ1008 ST7LITE2 IPS5451 UPD17010 EA1006AE
Product Description
Full Text Search
 

To Download AN1109 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  application note st10x167/f168 ? 7102977 a 30, nov 1998 minimizing power consumption for spi eeproms many industrial and automotive applications use external spi eeproms to back-up key data. power consumption must be minimized during back-up to spi eeproms. this becomes critical when decoupling capacitors are used to store the energy necessary to complete the data back-up process. this application note explains how to use spi eeprom page mode operation for low power consumption, and gives advice on optimum data mapping and peripheral configurations. a c-language implementation of the spi eeprom page mode operation is contained in the appendix. configurations outlined in this application note keep the st10 in idle mode for most of the write to the external eeprom. a 50% savings in power consumption can be achieved for both st10f168 and st10c167 by using spi eeprom page mode, mapping data into internal ram and stopping unused peripherals during data back-up. power consumption savings are defined by the ratio: idle current / operating current. to assess the saving for your application, check the power consumption defined in the product data sheet. features such as, built-in error detection on spi, and eeprom write protection mechanism, can be used to further secure the back-up of key data into external spi eeprom.
minimizing power consumption for spi eeproms 2/7 7102977 a 1 introduction the st10 microcontroller has 2 power reduction modes: ? power down mode: the cpu and all the peripherals are stopped. exit from power-down is only possible through an external interrupt signal. this mode gives the best power consumption savings. ? idle mode: the cpu is stopped but all the peripherals remain active. exit from idle mode is through the external interrupt signal or by internal interrupt. for most applications, idle mode is preferred because the device can resume operation on a pre-defined peripheral event (end of transfer on spi bus and/or end of write into external eeprom). program flows should take advantage of idle mode by relying on peripherals hardware features rather than software instructions. 2 minimizing power consumption 2.1 spi eeprom page mode operation for low power consumption many spi eeproms operate read and write sequences in page mode (see non-volatile data books on http://www.st.com). this feature can be used to reduce st10 power consumption during data transfer. the program flow described below and shown in figure 1, transfers data to an spi eeprom but keeps the st10 in idle mode for most of the transfer. program flow 1 data is transferred from the ram to the spi transmit register by pecc transfer. 2 the st10 is put in idle mode during page transfer to the external spi eeprom. 3 when the page transfer is complete, the cpu is put in idle mode for the duration of the write to spi eeprom (using an internal timer). 4 at the end of the write sequence, the timer wakes-up the st10 and the cpu checks whether another page is to be written to the external spi eeprom. a c-language implementation and assembly implementation of the power control instructions, are given in sections 2.3 and 2.4. a c-routine is given in section appendix - c function example on page 5.
minimizing power consumption for spi eeproms 7102977 a 3/7 figure 1 program flow initiate ssc in spi, initiate pecc, initiate timer initiate transfer for first page st10 in idle mode start timer for eeprom write more data to save? end of transfer initiate pec for next page yes interrupt: end of timer (write duration) interrupt: pecc counter reaches 0 no
minimizing power consumption for spi eeproms 4/7 7102977 a 2.2 other ways to reduce power consumption mapping data into internal ram only where possible, map data into st10 internal ram instead of external memory. the internal ram can either be the internal dual-port ram, or the internal xram. the current required to address external memory is greater than that for internal memory. stop unused peripherals during data back-up during the data back-up process, stop all unused peripherals in the following ways: ? unused timers: clear bit in the relevant txcon registers, ? unused capcoms: stop the capcom timers/counters by clearing bits txr in t01con or t78con registers, ? unused pwms: stop the timers by clearing bit ptrx in pwmconx registers. ? asynchronous serial interface: the baud asc baud rate generator can be stopped by clearing bit s0r in s0con register. port configuration where possible, configure ports for minimum power consumption. 2.3 c language implementation power control instructions in c are usually handled by intrinsic functions. for the tasking tool chain, the intrinsic function for idle is _idle. the tasking tool chain can directly handle sfrs provided that the targeted st10 register definition is included in the c source file. as the st10 resumes the program just after the idle instruction, the interrupt service routines for both the timer and spi_transmit can be reduced to reti. then the whole program flow can be implemented in one c function. an example of such a c function is shown in section . this example gives the st10 configuration for the data back-up process. the program flow can be modified perform a data integrity check, or enable st10 error detection on spi (phase error, receive error) 2.4 assembly implementation the instruction to put the st10 in idle is idle. the suggestions made for the interrupt service routines are also applicable here.
minimizing power consumption for spi eeproms 7102977 a 5/7 3 conclusion a 50% savings in current consumption can be achieved for both st10f168 and st10c167 by using spi eeprom page mode, mapping data into internal ram and stopping unused peripherals during data back-up. power consumption savings are defined by the ratio: idle current / operating current. features such as, built-in error detection on spi, and eeprom write protection mechanism, can be used to further secure the back-up of key data into external spi eeprom. appendix - c function example the c routines below illustrates an implementation of the program flow detailed in section 2.1. // include to have declaration of srfregisters and sfrbits #include // function prototypes void init_spi_page_write(); void spi_save(int addr); void spi_send_write_cmd(int addr); // functions // main spi transfer function void spi_save(int addr) // assume write into eeprom is enabled { int i; init_spi_page_write(); // init ssc in spi for page transfer for (i=0; i=3; i++) // example for fixed length transfer : 4 pages { sscie = 0; // mask spi interrupt during instruction + address phase spi_send_write_cmd(int addr); // send the write command : instruction + address ssctic= ssctic | 0x00c0; // set interrupt request to start page transfer + enable interrupt _idle; // put the st10 in idle until page transfer is completed txr=1; // set bit txr to start timer _idle; // put the st10 in idle for the write duration pecc0 = 0x01yy; // prepare pecc0 for next page transfer} } } // eeprom is assumed to be reprotected after this
minimizing power consumption for spi eeproms 6/7 7102977 a // function called by main spi transfer // other functions void spi_send_write_cmd (int addr) // send command and address for write { if (addr > 255) // eeprom is assumed in write enable state { ssctb = 0x000a; // depend on eeprom size addr = addr -256; } else { ssctb = 0x0002; } ssctb = (char) addr; // take only low byte while (ssctic & 0x0040 ) // wait end of transmit of 2nd byte { } } // function called by main spi transfer function void init_spi_page_write() // init spi to transfer pages { p3 = p3 | 0x2200; dp3 = pp3 | 0x2200; sscbr = spi_reload; // depend on bit rate pecc0 = 0x01yy; // byte transfers, yy is the eeprom page size in bytes ssctic = 0x0078; dstp0 = 0xf0b0; // ssctb srcp0 = 0xe000; // buffer is in xram starting at e000h ssccon = 0xc037; // msb first, ignore errors (check your configuration) tx = timer_x_reload; // depend on eeprom write timings txcon = 0x0; // timer in timer mode, count-up (check prescaler factor) }
minimizing power consumption for spi eeproms 7102977 a 7/7 information furnished is believed to be accurate and reliable. however, stmicroelectronics assumes no responsibility for the consequences of use of such information nor for any infringement of patents or other rights of third parties which may result from its use. no license is granted by implication or otherwise under any patent or patent rights of stmicroelectronics. specifications mentioned in this publication are subject to change without notice. this publication supersedes and replaces all information previously supplied. stmicroelectronics products are not authorized for use as critical components in life support devices or systems without express written approval of stmicroelectronics. the st logo is a registered trademark of stmicroelectronics ? 1998 stmicroelectronics - all rights reserved stmicroelectronics group of companies australia - brazil - canada - china - france - germany - italy - japan - korea - malaysia - malta - mexico - morocco the netherlands - singapore - spain - sweden - switzerland - taiwan - thailand - united kingdom - u.s.a. http://www.st.com


▲Up To Search▲   

 
Price & Availability of AN1109

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X